package com.xmindguoguo.boot.config.web;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 把html的自定义目录，也动态化监听，也可以配置映射上传文件目录
 * 
 * @ClassName WebResourceConfig
 * @author <a href="892042158@qq.com" target="_blank">于国帅</a>
 * @date 2019年1月1日 上午12:00:28
 *
 */
@Configuration
public class WebResourceConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/**").addResourceLocations("/");
        // registry.addResourceHandler("/templates/**").addResourceLocations("classpath:/templates/");
        // registry.addResourceHandler("/static/**").addResourceLocations("classpath://static/");
//        registry.addResourceHandler("/upload/**").addResourceLocations("file:///D:/WebFies/uploaded/upload/");
        registry.addResourceHandler("/WEB-INF/**").addResourceLocations("classpath:/WEB-INF/**");

        super.addResourceHandlers(registry);
    }

}
